﻿using System;
using System.Collections.Generic;

using mvcForum.Core;
using mvcForum.Core.Abstractions;
using mvcForum.Core.Interfaces.Data;

namespace mvcForum.AddOns.NewUserTrial {

	public class NewUserTrialConfiguration : AsyncAddOnConfiguration<NewUserTrialAddOn> {

		private static class Keys {
			public const String Enabled = "Enabled";
			public const String AutoQuarantine = "AutoQuarantine";
			public const String AutoLimit = "AutoLimit";
			public const String ExcludeGroups = "ExcludeGroups";
		}

		public NewUserTrialConfiguration(IRepository<AddOnConfiguration> configRepo) : base(configRepo) { }

		public Boolean Enabled {
			get {
				return this.GetBoolean(Keys.Enabled);
			}
			set {
				this.Set(Keys.Enabled, value);
			}
		}

		public Int32 AutoLimit {
			get {
				return this.GetInt32(Keys.AutoLimit);
			}
			set {
				this.Set(Keys.AutoLimit, value);
			}
		}

		public IEnumerable<Int32> ExcludeGroups {
			get {
				return this.GetCollection(Keys.ExcludeGroups);
			}
			set {
				this.Set(Keys.ExcludeGroups, value);
			}
		}
	}
}